//
//  LBTILiveManager.h
//  LBTILiveSDK
//
//  Created by 刘文扬 on 2018/3/13.
//

#import <Foundation/Foundation.h>
#import <TILLiveSDK/TILLiveManager.h>
#import <LBURLConfig.h>
#import <ILiveSDK/ILiveSDK.h>
#import <TILLiveSDK/TILLiveCommon.h>

// 不具备登录以及登出功能,这些功能都在IM上

typedef NS_ENUM(NSInteger,LBAVRole)
{
    LBAVRoleHost = 1,
    LBAVRoleInteractGuest,
    LBAVRoleGuest
};

@protocol LBTILiveManagerDelegate <NSObject>

- (void)onInputViewText:(NSString *)text;

@end

@interface LBTILiveManager : NSObject


+(instancetype)shareManager;

//基础功能

//测试
-(void)login;

//正式
-(void)loginWithUserId:(NSString *)userId sign:(NSString *)sign;
-(void)initSDK;


//视频直播功能

//设置监听,包括IM消息的监听
-(void)addIMListener:(id<ILVLiveIMListener>)listener;

//设置AVListener监听
-(void)addAVListener:(id<ILVLiveAVListener>)listener;

//设置主渲染
-(void)setAVRootView:(UIView *)avRootView;



-(void)openCamera;

-(void)closeCamera;

- (void)onSwitchCamera;

- (void)onOpenMic;

-(void)closeMic;

-(void)createRoomWithId:(NSString *)roomId;


-(void)joinRoomWithId:(NSString *)roomId role:(LBAVRole)role;


-(void)quitRoom;

//销毁的时候使用,退出房间,并且销毁所有的渲染
-(void)releaseResouce;

+ (void)requestVideoAccessWithHandler:(void (^)(NSError *))handler;
+ (void)requestAuidoAccessWithHandler:(void (^)(NSError *))handler;

@end
